package com.tgy.studentmanagement.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.tgy.studentmanagement.myAnnotation.EnumValue;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * (Students)实体类
 *
 * @author
 * @since 2023-04-12 09:10:11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("students")
public class Students implements Serializable {
    private static final long serialVersionUID = 892526121032794497L;
    /**
     * 学生id
     */
    @Excel(name = "ID", width = 10)
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    /**
     * 学生姓名
     */
    @NotBlank(message = "学生姓名不允许为空")
    @Excel(name = "学生姓名", width = 20, needMerge = true)
    private String name;
    /**
     * 学号
     */
    @NotBlank(message = "学生学号不允许为空")
    @Excel(name = "学号", width = 10)
    private String studentId;
    /**
     * 学生年龄
     */
    @NotNull(message = "学生年龄不允许为空")
    @Min(value = 0, message = "学生年龄不允许为负数")
    @Excel(name = "学生年龄", width = 10)
    private Integer age;
    /**
     * 学生性别
     */
    @EnumValue(strValues = {"男", "女"},message = "学生性别必须为男/女")
    @Excel(name = "学生性别", width = 10)
    private String gender;
    /**
     * 学生专业
     */
    @Excel(name = "学生专业", width = 20)
    private String major;
    /**
     * 学生班级
     */
    @Excel(name = "学生班级", width = 10)
    private String classInfo;

}

